package com.zmc.lostfound.auth.vo;

import com.zmc.lostfound.common.constant.RegexConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

import static com.zmc.lostfound.common.constant.RegexConstant.EMAIL_REGEX;

/**
 * @author zmc
 * @description 用户更换绑定邮箱请求体
 */
@Data
@ApiModel("用户更换绑定邮箱请求体")
public class UpdateEmailVO implements Serializable {

    private static final long serialVersionUID = -7210010941663935157L;

    /**
     * 用户id
     */
    @ApiModelProperty("用户id")
    @NotNull(message = "用户id不能为空")
    @Min(value = 1, message = " 用户id必须大于等于1")
    private Long id;

    /**
     * QQ邮箱
     */
    @ApiModelProperty("QQ邮箱")
    @NotBlank(message = "QQ邮箱不能为空")
    @Pattern(regexp = EMAIL_REGEX, message = "QQ邮箱格式错误")
    private String qqEmail;

    /**
     * 邮箱验证码
     */
    @ApiModelProperty("邮箱验证码")
    @NotBlank(message = "邮箱验证码不能为空")
    @Pattern(regexp = RegexConstant.CAPTCHA_REGEX, message = "验证码必须由6位数字组成")
    private String captcha;

}
